package com.shop.myweb.utils;

import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;

@Slf4j
public class RedisUtils {

    public static boolean isRedisAvailable(RedisTemplate<String, Object> redisTemplate) {
        try {
            redisTemplate.getConnectionFactory().getConnection().close();
            return true;
        } catch (Exception e) {
            log.error("Failed to connect to Redis", e);
            return false;
        }
    }
}
